package sagroup.dracots;

import java.net.UnknownHostException;

import lime2.Location;
import lime2.PolicyException;
import sagroup.util.Lights;

public class ProposeAbstractSlave extends ProposePartin {

	public ProposeAbstractSlave(int index) throws UnknownHostException,
			PolicyException {
		super(ports[index], ports[index] + 7000);
	}

	public static void main(String[] args) throws UnknownHostException,
			PolicyException, InterruptedException {
		// deal with parameters
		if (args.length != 1) {
			System.out.println("must has parameters like:0");
			System.exit(0);
		}

		NodePartinTesting slave = new ProposeAbstractSlave(Integer
				.valueOf(args[0]));

		DracoTuple t = slave.ts.out(new FlatSignalTuple(TUPLE_TYPE, Location.HERE, Lights
				.creatTuple("slaveACK")));
		logger.info(t.toString());
		while (true) {
			Thread.sleep(2000);
		}
	}
}
